package copyengine.ui.tooltips.animation
{
	import com.greensock.TweenLite;

	import flash.display.DisplayObject;

	public class CETweenAlphaToolTipsAnimation implements ICETooltipsAnimation
	{
		/**
		 * define how long the tween is.
		 */
		private static const TWEEN_TIME:Number = 0.2;

		private var tooltipsMc:DisplayObject;

		public function CETweenAlphaToolTipsAnimation()
		{
		}

		public function setTarget(_tooltipsMc:DisplayObject):void
		{
			tooltipsMc = _tooltipsMc;
		}

		public function showTips():void
		{
			TweenLite.killTweensOf(tooltipsMc);
			tooltipsMc.alpha = 0;
			TweenLite.to(tooltipsMc, TWEEN_TIME, {alpha:1});
		}

		public function hideTips():void
		{
			TweenLite.killTweensOf(tooltipsMc, true);
			tooltipsMc.alpha = 1;
			TweenLite.to(tooltipsMc, TWEEN_TIME, {alpha:0});
		}

		public function dispose():void
		{
			TweenLite.killTweensOf(tooltipsMc);
		}
	}
}